package com.bcu.cn.onlineexamsystem.exammanage.service.impl;

import com.bcu.cn.onlineexamsystem.exammanage.entity.Class;
import com.bcu.cn.onlineexamsystem.exammanage.mapper.ClassMapper;
import com.bcu.cn.onlineexamsystem.exammanage.service.ClassService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class ClassServiceImpl implements ClassService {
    private static final Logger logger = LoggerFactory.getLogger(ClassServiceImpl.class);
    
    @Autowired
    private ClassMapper classMapper;
    
    @Override
    public List<Class> getClassesByTeacherId(String teacherId) {
        logger.info("开始查询教师[{}]的班级列表", teacherId);
        List<Class> classes = classMapper.findByTeacherId(teacherId);
        logger.info("查询到教师[{}]的班级数量: {}", teacherId, classes.size());
        return classes;
    }

    @Override
    public Class getClassById(Long classId) {
        return classMapper.findById(classId);
    }
} 